package com.loan.system.service.impl;

import com.loan.common.core.domain.PageQuery;
import com.loan.common.core.page.TableDataInfo;
import com.loan.system.service.DataService;
import com.loan.system.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@RequiredArgsConstructor
public class DataServiceImpl implements DataService {

    private final UserService userService;

    @Override
    public TableDataInfo<Map<String, Object>> selectPageRegisterDataList(String channel, String beginTime, String endTime, PageQuery pageQuery) {
        Integer pageNum = (pageQuery.getPageNum() - 1) * pageQuery.getPageSize();
        Integer pageSize = pageQuery.getPageSize();
        return userService.selectPageRegisterDataList(channel, beginTime, endTime, pageNum, pageSize);
    }

    @Override
    public List<Map<String, Object>> selectTotalList(String channel, String beginTime, String endTime) {
        return userService.selectTotalList(channel, beginTime, endTime);
    }
}
